<?php

use middleware\CrossDomain;
use middleware\Flow;
use middleware\Validate;
	
class Application {

	protected static $instance = null;

	protected $middleware = [
		"cross_domain" => CrossDomain::class,
		"flow" => Flow::class,
		"validate" => Validate::class
	];

	protected function __construct()
	{

	}

	public static function getInstance()
	{
		if (!self::$instance) {
			self::$instance = new self();
		}

		return self::$instance;
	}

	public function run() 
	{

		return function ($param) {
			return "开始执行应用：$param <br/>";
		};

	}

	public function getMiddleWare()
	{
		return $this->middleware;
	}


}


?>